﻿Imports DTO

Public Class DAGroup
    Inherits DataProvider
    Shared Sub ConfigServerName(ByVal serverName As String)

        ' call constructor base class
        ConfigServer(serverName)

    End Sub
    '/******************************************************************/
    '/*             Lay datatable tu DataProvider voi SP               */
    '/******************************************************************/
    Shared Function GetAllGroup() As DataTable
        Return Query("getAllGroup")
    End Function

    '/******************************************************************/
    '/*                     Insert group to database                   */
    '/******************************************************************/
    Shared Function InsertGroup(ByVal dtoGroup As DTOGroup) As Integer
        Return Update("insertGroup", {"@groupID", "@groupName"}, {dtoGroup.GroupIdProperty, dtoGroup.GroupNameProperty})
    End Function

    '/******************************************************************/
    '/*                     Delete group in database                   */
    '/******************************************************************/
    Shared Function DeleteGroup(ByVal groupID As Integer) As Integer
        Return Update("deleteGroup", {"@groupID"}, {groupID})
    End Function

End Class
